package com.xuyuan;

import com.xuyuan.spring.auto.in.CustomImportBeanDefinitionRegistrar;
import com.xuyuan.spring.auto.in.CustomImportSelector;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;

@MapperScan(basePackages = "com.xuyuan.mybatis.mapper")
@SpringBootApplication(scanBasePackages = "com.xuyuan",
        exclude = {
                org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration.class,
                org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration.class
        })
@Import({CustomImportSelector.class, CustomImportBeanDefinitionRegistrar.class})
// @EnableDiscoveryClient
public class App {

    private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        SpringApplication.run(App.class, args);
        Runtime.getRuntime().addShutdownHook(new Thread(() -> LOGGER.info("程序退出了")));
    }
}
